#!/usr/bin/env python
from twisted.internet import wxreactor
wxreactor.install()
from twisted.internet import reactor

import wx
from ChessController import BasicController
from MoveList import MoveList
from ChatWindow import ConsoleControl

if __name__ == '__main__':
    app = wx.PySimpleApp()
    frame = wx.Frame(None, wx.ID_ANY, "Complete program test app")
    movelist = MoveList(frame)
    testcontroller = BasicController(frame, (360,360), movelist)
    chat = ConsoleControl(frame, wx.ID_ANY, (500,200))

    chessSizer = wx.BoxSizer(wx.HORIZONTAL)
    chessSizer.Add(testcontroller,1,wx.EXPAND)
    chessSizer.Add(movelist,0,wx.EXPAND)
    
    mainSizer = wx.BoxSizer(wx.VERTICAL)
    mainSizer.Add(chessSizer,2,wx.EXPAND)
    mainSizer.Add(chat,1,wx.EXPAND)

    frame.SetSizer(mainSizer)
    frame.Fit()
    frame.Show()
    
    reactor.registerWxApp(app)
    reactor.run()